from configparser import ConfigParser
from core import settings
import os

"""配置文件使用模块"""


class UseCofg:

    def __init__(self, file_path):
        if file_path:
            cog_path = file_path
        else:
            os.mkdir(settings.Cfg_path)
        self.cofg = ConfigParser()
        self.cofg.read(cog_path, encoding="utf-8")

    def use_cofg(self, a, b):
        value = self.cofg.get(a, b)
        return value
